<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;
// Route::rule('路由表达式','路由地址','请求类型','路由参数(数组)','变量规则(数组)');
//课程主页(course)
    Route::any('cindex','admin/course/index');
//添加课程
    Route::get('cadd','admin/course/add');
    Route::post('cs','admin/course/save',['method'=>'post'],['ext'=>'html|shtml']);
//编辑课程
    Route::get('edit/[:id]','admin/course/edit');
//更新用户编辑之后的信息
    Route::post('cupdate','admin/course/update');
//删除课程
    Route::rule('delete/:id','admin/course/delete');
//班期主页(classdate)
    Route::any('clindex','admin/classdate/index');
//添加班期
    Route::get('cladd','admin/classdate/add');
    Route::any('cls','admin/classdate/save',['ext'=>'html|shtml']);
//编辑班期
    Route::get('cledit/[:id]','admin/classdate/edit');
//搜索功能
    Route::any('select','admin/classdate/select');
//更新班期编辑之后的信息
    Route::post('clupdate/[:id]','admin/classdate/update');
//删除班期
    Route::rule('cldelete/:id','admin/classdate/delete');
//文章主页(article)
    Route::any('artindex','admin/article/index');
//添加文章
    Route::get('artadd','admin/article/add');
    Route::post('arts','admin/article/save',['method'=>'post'],['ext'=>'html|shtml']);
//编辑文章
    Route::get('artedit/[:id]','admin/article/edit');
//更新文章编辑之后的信息
    Route::post('artupdate','admin/article/update');
//删除文章
    Route::rule('artdelete/:id','admin/article/delete');
//教师主页(teacher)
    Route::any('techindex','admin/teacher/index');
//添加教师风采内容
    Route::get('techadd','admin/teacher/add');
    Route::post('techs','admin/teacher/save',['method'=>'post'],['ext'=>'html|shtml']);
//编辑教师风采内容
    Route::get('techedit/[:id]','admin/teacher/edit');
//更新教师风采编辑之后的信息
    Route::post('techupdate','admin/teacher/update');
//删除该教师的信息
    Route::rule('techdelete/:id','admin/teacher/delete');

////登录(前台)
//    Route::any('login1','index/log/login',['ext'=>'html|shtml']);
////执行登录
//    Route::post('dologin1','index/log/dologin',['ext'=>'html|shtml']);

 //前台后台主页
Route::any('home','index/index/index');
Route::any('adm','admin/index/index');
Route::any('/','index/index/index');

//URL生成
Route::get('admin','admin/Main/index');
Route::get('admin/login','admin/Login/login');
Route::get('log','index/Login/login');
Route::any('dolog','index/Login/dologin');
Route::any('reg','index/Register/register');
Route::any('doReg','index/Register/doRegister');
Route::post('checktel','index/Register/checktel');
Route::post('checkusername','index/Register/checkusername');
Route::get('/','index/Index/index');
Route::get('user/list','admin/User/index');
Route::get('user/edit','admin/User/edit');
Route::post('doEdit','admin/User/doEdit');
Route::get('user/add','admin/User/add');
Route::post('doAdd','admin/User/doAdd');
Route::get('del','admin/User/dodel');

return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];
